package com.freesky.biz.icbc.controller;

import com.freesky.biz.icbc.domain.TAigouFriday;
import com.freesky.biz.icbc.domain.TMobileRecharge;
import com.freesky.biz.icbc.service.IAigouFridayService;
import com.freesky.biz.icbc.service.IMobileRechargeService;
import com.freesky.common.annotation.Log;
import com.freesky.common.core.controller.BaseController;
import com.freesky.common.core.domain.AjaxResult;
import com.freesky.common.core.page.TableDataInfo;
import com.freesky.common.enums.BusinessType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * 爱购星期五
 */
@RestController
@RequestMapping("/icbc/aigouFriday")
public class AigouFridayController extends BaseController {

    @Autowired
    private IAigouFridayService aigouFridayService;

    /**
     * 爱购星期五列表
     */
    @PreAuthorize("@ss.hasPermi('icbc:aigoufriday:list')")
    @GetMapping("/list")
    public TableDataInfo list(TAigouFriday aigouFriday) {
        startPage();
        List<TAigouFriday> list = aigouFridayService.findList(aigouFriday);
        return getDataTable(list);
    }

    @Log(title = "爱购星期五", businessType = BusinessType.EXPORT)
    @PreAuthorize("@ss.hasPermi('icbc:aigoufriday:export')")
    @GetMapping("/export")
    public AjaxResult export(TAigouFriday aigouFriday,
                             HttpServletResponse response) {
        return aigouFridayService.exportFile(aigouFriday);
    }

}
